<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>捕获异常</title>
    <script type="text/javascript">
    let name = '李思';
    let age = 18;
     /*
     let person = {
         name:name,
         age:age,
         showname:function(){
             alert(this.name);
         },
     }
     */
     // 简写成下面的形式
     let person2 = {
         name,
         age,
         showname(){
           alert(this.name);
         }
     };
     person2.showname();

     // 3.箭头函数
    //ES6标准新增的一种新的函数，Arrow Function
    //let log = function(){
    //      alert('no param')
    //      }
    let log = () =>{alert('no param')};

    // let show = function(response){
    //     alert(response)
    //    }
    let show = response => {alert(response)};
    show('hello');


    </script>
</head>
<body>

</body>
</html>